# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=tiny-dfr
pkgver=0.1.2
pkgrel=0
pkgdesc="Apple silicon touch bar input / display daemon"
url="https://github.com/WhatAmISupposedToPutHere/tiny-dfr"
arch="aarch64"
license="MIT"
makedepends="cargo pango-dev libinput-dev gdk-pixbuf-dev libxml2-dev"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/WhatAmISupposedToPutHere/tiny-dfr/archive/refs/tags/v$pkgver.tar.gz
	tiny-dfr.initd"

build() {
	cargo build --release --all-features
}


package() {
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm755 target/release/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 share/$pkgname/*.svg -t "$pkgdir/usr/share/$pkgname"
	install -Dm644 etc/udev/rules.d/99-touchbar-seat.rules "$pkgdir/usr/lib/udev/rules.d/99-touchbar-seat.rules"
	install -Dm644 etc/udev/rules.d/99-touchbar-tiny-dfr.rules "$pkgdir/usr/lib/udev/rules.d/99-touchbar-tiny-dfr.rules"
}

sha512sums="
0a484c996c50f97b9d9eac569cd7883217cff934977c195d961ddda576039196e737c112a69a6759fb855675b6d0c8bb3b564be0e3d04c72ff0fdb7f194a6718  tiny-dfr-0.1.2.tar.gz
5f51a4ee10cb0dec82987fe06aa3b98bb6cf59235ec6b2b61593e8cf62b319adc5ccb7b01ee6944871ebfe9e4a18c493ec353a4621248d1e2b2191b0a90e674f  tiny-dfr.initd
"
